﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataAccess;
using System.Data;

namespace Bussiness {
    public class CategoryBuss {
        public DataTable getCategories() {
            CategoryRespository repository = new CategoryRespository();
            return repository.getCategories();
        }

        public DataTable getCategories(int parentCatID) {
            CategoryRespository repository = new CategoryRespository();
            return repository.getCategories(parentCatID);
        }
        public bool delete(int catID) {
            CategoryRespository repository = new CategoryRespository();
            return repository.delete(catID);
        }

        public bool add(String catName, int parentCatID = 0) {
            CategoryRespository repository = new CategoryRespository();
            return repository.add(catName, parentCatID);
        }

        public bool update(int catID, String catName, int parentCatID = 0) {
            CategoryRespository repository = new CategoryRespository();
            return repository.update(catID, catName, parentCatID);
        }
    }
}
